package bold.deposit;

import bold.deposit.interception.NoAuthorize;
import bold.deposit.useful.CookieUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Map;

@Log4j2
@RestController
@NoAuthorize
public class SessionController {


    @RequestMapping("session")
    public Object session(HttpServletRequest request) {
        Map<String, String> stringMap = CookieUtil.getCookieAll(request);

        HttpSession session = request.getSession();
        log.info(JSON.toJSON(session));
        return "";
    }
}
